UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't+GlNZly022AsXAUWnGNbabmFytTgORD8TyI6HIGGZc=' 
WHERE 
  key_id = 'ea86c7c5bd1c802c570bda78302f7850ae91e6cf7254ee50a68f3444acf83bae' 
  AND (
    token = 't+GlNZly022AsXAUWnGNbabmFytTgORD8TyI6HIGGZc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022