UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6JxPFl9GJsFemVTmowDkZ/m1GVbwlt0qqMvm19+TBHc='
WHERE
key_id = '3371f784a4f5c7a7e39d54cfc903c4d3ecb8f6b1c32a7c7944e2e694941dac6b'
AND (
token = '6JxPFl9GJsFemVTmowDkZ/m1GVbwlt0qqMvm19+TBHc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)