UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jcHU394DSdp6ZE55miQz4f73MH9lfMo7ckIOCZNYnRk='
WHERE
key_id = '7045fd6ecfce5694d1c25c40e04067b56f9374ad8517e328d53c27d055a3fe26'
AND (
token = 'jcHU394DSdp6ZE55miQz4f73MH9lfMo7ckIOCZNYnRk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)