UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1L7dMkpA1r+f5NerE+obUf00fwjaufU/REMTOCjq9lE='
WHERE
key_id = 'cc3da9376b12c30b86c849d1ee44af86d6563ced418fa52acd52c51465350a1a'
AND (
token = '1L7dMkpA1r+f5NerE+obUf00fwjaufU/REMTOCjq9lE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)