UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JNERyQYT9sdT6/FvfZe1pIGydBctBBkK2wdDhdVZByI='
WHERE
key_id = '969a1cc940c0469ff73e80fcf66bf87d3560830b6d201b8f67634ba104828c5c'
AND (
token = 'JNERyQYT9sdT6/FvfZe1pIGydBctBBkK2wdDhdVZByI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)