UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AtuIUYJsIYthZFYby/hr0bTuoa4oMlVP63I7+N1sqws='
WHERE
key_id = '64625560040361065421afeb69777068e94409255925c602cea2f9249809bb3d'
AND (
token = 'AtuIUYJsIYthZFYby/hr0bTuoa4oMlVP63I7+N1sqws='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)