UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ffmijEz/14l4pfJkuY7kRlefHfCOZUsRWi9+IuYg5qM=' 
WHERE 
  key_id = 'b8485dce69aec2cdcb0a57a6e9fccce4a9b9451c63904deaa7b4685091c39653' 
  AND (
    token = 'ffmijEz/14l4pfJkuY7kRlefHfCOZUsRWi9+IuYg5qM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051