UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EHEATaUMc56QBw0+fLgWC3+Lmi8IZy9fUFp81W4Yi24='
WHERE
key_id = 'f6574509063ba9ceca2a36138d04e28e22e5217ea264956f80b607ab9cba733a'
AND (
token = 'EHEATaUMc56QBw0+fLgWC3+Lmi8IZy9fUFp81W4Yi24='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)