UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YGjx0EekLkh9QiYKzX7fR4pYPbMM2BQ0kQTuBPsFalQ='
WHERE
key_id = '34bd7a36910df533926af6ae1a135d59cf735cce57e97677de2cbefc0af0bda8'
AND (
token = 'YGjx0EekLkh9QiYKzX7fR4pYPbMM2BQ0kQTuBPsFalQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)