UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DZpo0iAKtU71MNbUvp16vnpei7AHNJqeaOIrT2mQEvY='
WHERE
key_id = '215e1805567f6b92099806d8af29df916a03772d500acb8440b0a297e55bee00'
AND (
token = 'DZpo0iAKtU71MNbUvp16vnpei7AHNJqeaOIrT2mQEvY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)