UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H+Oesbh4I83YQ2TF3t1MtsCAiI0MktNPuDpbseH0dlE='
WHERE
key_id = 'b926257f8fbc4d74339fb8d75009811ff42203a7ba3857024e7ef8b477cf941c'
AND (
token = 'H+Oesbh4I83YQ2TF3t1MtsCAiI0MktNPuDpbseH0dlE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)