UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hRqnJsK8ucD2FjXbcGJkXRCkSmPzsUpscjOjfC9BK3w=' 
WHERE 
  key_id = '17fc6bb6046b592774fd264b5c8bccbd4db54932c46ff25a27ececf619db145f' 
  AND (
    token = 'hRqnJsK8ucD2FjXbcGJkXRCkSmPzsUpscjOjfC9BK3w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031