UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ggMEnPKbZAWRruCOuMGdT1LjIKy/Gx6iL8AHOrALwQY=' 
WHERE 
  key_id = 'd9bbad5775af05a6a800ecc442ba2ea278ac74a21a9d105f27132439ddf0413c' 
  AND (
    token = 'ggMEnPKbZAWRruCOuMGdT1LjIKy/Gx6iL8AHOrALwQY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041