UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qVFVoHhmEL+DskkR4ocu1hyk+Lh+adKo4cLVskB85ac='
WHERE
key_id = '287d2539b51cb506c181c49753dc004e3f2d2c70ed2dbe53d97907105b2f823d'
AND (
token = 'qVFVoHhmEL+DskkR4ocu1hyk+Lh+adKo4cLVskB85ac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)