UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kpZyuk0Ew/zTVrF+Sz9FSf2RqCPfj4Oww9IltneCp08='
WHERE
key_id = '9b15aa35cdb43fec814b1ece5b897627ea14a35c119901dea07b14c3326a3fcd'
AND (
token = 'kpZyuk0Ew/zTVrF+Sz9FSf2RqCPfj4Oww9IltneCp08='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)