UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CH6ROuOawFC8WmiSGEvC3JzbjuLghVV7AEzvecQD9RI='
WHERE
key_id = '986b92ec1a17769e895b431f6dcabadcabcddec6c0e1773c8ec160c4a51deaf1'
AND (
token = 'CH6ROuOawFC8WmiSGEvC3JzbjuLghVV7AEzvecQD9RI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)