UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'frtJns6utH9M8ha85RLoqdst07iwjIeZ70tECfxBEJ0='
WHERE
key_id = '303b42a62628727b3209e0b7eb53493fc84aa341f1d059063649bbfd4782aa9c'
AND (
token = 'frtJns6utH9M8ha85RLoqdst07iwjIeZ70tECfxBEJ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)