UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q12zl9/jm7s++0keCPn7UjlUTzB21VTVKz86eZVKztA=' 
WHERE 
  key_id = '9cfdf55a601a3988f47b8209ec490a8c11286a82b36b96795504e397e6e077c4' 
  AND (
    token = 'Q12zl9/jm7s++0keCPn7UjlUTzB21VTVKz86eZVKztA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036