UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/W8nDZQl17aeoo41sEaru1fzMGN+Vt7zxBw0FQdNY6Q='
WHERE
key_id = '87c5ab8b95b901386b8768b3bfe793a67a752980aff72dac0665156a5b6f75ee'
AND (
token = '/W8nDZQl17aeoo41sEaru1fzMGN+Vt7zxBw0FQdNY6Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)