UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yNvzXTnVkB9gpI41c0vSd+WJdlNtV3DAKCEoyRkWlD4=' 
WHERE 
  key_id = '9dc4bc9eb2622eb41995cf67434f5a9f128f64f708ce9a10bef078a1d34350a6' 
  AND (
    token = 'yNvzXTnVkB9gpI41c0vSd+WJdlNtV3DAKCEoyRkWlD4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036