UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UKNyos8KjJs355GGXeAlFZh6DLRPMsKL582+iSot7xM=' 
WHERE 
  key_id = 'e64060f960038e33ce935e91151262b317644b79c44d6751c8cbaf2989a5b90a' 
  AND (
    token = 'UKNyos8KjJs355GGXeAlFZh6DLRPMsKL582+iSot7xM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039