UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oM9cPQIYFfjsOfglz99tqM1cNE5XrKeyAlKIrkmYuTQ='
WHERE
key_id = '536aff534393e1e3a732f0c15fe9de3d5ad1dd16b070dd7168397e07b3827bcc'
AND (
token = 'oM9cPQIYFfjsOfglz99tqM1cNE5XrKeyAlKIrkmYuTQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)