UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rT69DaoLhT7d952/gq7a2bITqn1Xhh1DTjd1gLaNnSQ=' 
WHERE 
  key_id = '8d4b96c8d73105e5a143a9def053e1a3eea600aa638411f96a251c7b48cfb271' 
  AND (
    token = 'rT69DaoLhT7d952/gq7a2bITqn1Xhh1DTjd1gLaNnSQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033