UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '373rfw3tivoEB2B5oJ4EKPt8130fs20xKnIPeKfle3E='
WHERE
key_id = '7636f0ea393b33633371d63220bfe75975bb3decf65848e41936b724f9b90298'
AND (
token = '373rfw3tivoEB2B5oJ4EKPt8130fs20xKnIPeKfle3E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)