UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nrkCqrJw+s5zlYsS+kx/tu/Z1zpQNQCSVFpIOkWR+Uw=' 
WHERE 
  key_id = '3fb9af901db9380f5bbfb6f6dadfd2d405ea0c4bd317332c515eeda20120a4ee' 
  AND (
    token = 'nrkCqrJw+s5zlYsS+kx/tu/Z1zpQNQCSVFpIOkWR+Uw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031