UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pnR6EK+nNOv5R9t/+ZDDUycIU/To1OGg7cfgRJwatJQ=' 
WHERE 
  key_id = '1b5ff851a88ff105485780948571ac4a218a8a91e6438a602b60cecef520b802' 
  AND (
    token = 'pnR6EK+nNOv5R9t/+ZDDUycIU/To1OGg7cfgRJwatJQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046