UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IuPWUfQCJE5Mw00/8A2NQEIFuMuUPHQt4BEionW0GK0='
WHERE
key_id = '23b2c5bb7a38143dfb51cea9561fce5c8c31ecf23df274a06d4708490a872430'
AND (
token = 'IuPWUfQCJE5Mw00/8A2NQEIFuMuUPHQt4BEionW0GK0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)