UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G5EeEv5v1ucw+51Sc7Cu+0JB51JcxCFT1FqKJm8eYLE=' 
WHERE 
  key_id = 'a5269df0414c2eebab71b42e41d8fbb5208d8ff32dcdbbc1b8b55f3bddc0d33a' 
  AND (
    token = 'G5EeEv5v1ucw+51Sc7Cu+0JB51JcxCFT1FqKJm8eYLE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033