UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6PenQFmrf4J1BhLkUPDhnq4bm441tHE5SY6g8SIRhfI='
WHERE
key_id = 'eee67ce0002f0a9a907077f809ef29156e2bd36b4d0cba2ebdef3976a2238d68'
AND (
token = '6PenQFmrf4J1BhLkUPDhnq4bm441tHE5SY6g8SIRhfI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)