UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AVU7ESBIdhXHkrfrpcQcuU5m+yufv9nWhC/sNvlOKoU='
WHERE
key_id = '92416d59961448af0af0d25d5fd386e769df4821d34e59a7921adec1e5f9ad14'
AND (
token = 'AVU7ESBIdhXHkrfrpcQcuU5m+yufv9nWhC/sNvlOKoU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)