UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7VyGvxBkC4eWxOWdTr3Z1gqA742IMvGRaDfEStk0SeA=' 
WHERE 
  key_id = '91863ba6e2dd87cb4aa2238ca33e99c718d99ba4ca0dbb47cfdd927c69488908' 
  AND (
    token = '7VyGvxBkC4eWxOWdTr3Z1gqA742IMvGRaDfEStk0SeA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029