UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vx4vphdpIpJXDhqHXVnbvBB5pI44uScDow5ficSAYlE=' 
WHERE 
  key_id = '0650794ae27b34a47d12f961c8b7ce37be851d762bc71d1bb8a18c8825f54008' 
  AND (
    token = 'vx4vphdpIpJXDhqHXVnbvBB5pI44uScDow5ficSAYlE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028