UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xF93mpn4WVMkJq3hSSygq38HV4YRL8WlJa3AJbM0czg='
WHERE
key_id = '4807836829f2e075d8f28476ddee03c2e926d029fa9f5a9c56d04ae46580a6dd'
AND (
token = 'xF93mpn4WVMkJq3hSSygq38HV4YRL8WlJa3AJbM0czg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)